import { httpRequst } from './http.interceptor.js'

//登录
export const LOGIN = (data) => httpRequst('POST', '/ScUser/login', data)
//通过userId获取个人信息
export const byUserIdMessage = (id) => httpRequst('GET', `/scancode/user/getInfo?id=${id}`)

//菜品分类
export const get_classify = () => httpRequst('GET', '/scancode/classify/list')
//全部菜品
export const Food_List = () => httpRequst('GET', `/scancode/food/list`)
//根据分类查菜品
export const get_classifyFood = (id) => httpRequst('GET', `/scancode/food/findFdByCla?classifyId=${id}`)
//根据id查菜品详情
export const searchFoodId = (id) => httpRequst('GET', `/scancode/food/getInfo?id=${id}`)
//根据id查菜品评论
export const searchFoodComment = (id) => httpRequst('GET', `/scancode/comment/findComByfodId?foodId=${id}`)
//商家详情
export const BusinessDetail = () => httpRequst('GET', `/scancode/business/list`)
//下单
export const placeOrder = (id) => httpRequst('GET', `/scancode/specifications/findFsByOdrId?orderId=${id}`)
//根据id查菜品规格
export const foodSpecification = (id) => httpRequst('GET', `/scancode/specifications/findFsByFodId?foodId=${id}`)
//微信支付
export const wxPay = (data) => httpRequst('POST', `/order/weChatPay`, data)
//新增订单
export const addOrder = (data) => httpRequst('POST', `/scancode/orderMaster/add`, data)
//修改订单
export const editOrder = (data) => httpRequst('POST', `/scancode/orderMaster/edit`, data)
//新增规格
export const specAdd = (data) => httpRequst('POST', `/scancode/orderDetail/add`, data)
//根据userId获取订单信息
export const byUserId_OrderDetail = (id) => httpRequst('GET', `/scancode/orderMaster/findAllByUserId?userId=${id}`)
//根据orderId获取菜品信息(包含图片)
export const byOrderId_foodDetail = (id) => httpRequst('GET', `/scancode/specifications/findFsByOdrId?orderId=${id}`)
//根据orderId获取订单信息
export const byOrderId_OrderDetail = (id) => httpRequst('GET', `/scancode/orderMaster/getInfo?id=${id}`)
//根据orderId获取订单  包含数量
export const byOrderId_OrderNum = (id) => httpRequst('GET', `/scancode/orderDetail/findByOrderId?orderId=${id}`)
//订单列表
export const orderList = () => httpRequst('GET', `/scancode/orderDetail/list`)
//获取待评价订单
export const remainEvaluated = (id) => httpRequst('GET', `/scancode/orderMaster/findNotComByUserId?userId=${id}`)
//获取我的评价订单
export const havaEvaluated = (id) => httpRequst('GET', `/scancode/comment/findAllByuserId?userId=${id}`)
//发表评论
export const publishEvaluation = (data) => httpRequst('POST', `/scancode/comment/add`, data)
//修改个人信息
export const editPersonMessage = (data) => httpRequst('POST', `/scancode/user/edit`, data)
//退出登录
export const logout = () => httpRequst('GET', `/ScUser/tokenLogout`)